<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>javascript</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box
    }
    body {
      font-size: 14px;
      padding: 20px;
    }
    ul li {
      line-height: 30px;
    }
  </style>
</head>
<body>
  <ul>
    <li></li>
  </ul>
</body>
<script>
    function test() {
        console.log(2)
    }
    test.name = 'zhangli';
    test.show = function() {
        console.log(3)
    }
    
    console.log(test.__proto__ === Function.prototype);
    function add(a, b) {
        return a+b
    }
    function Add() {

    }
    console.dir(Add.prototype.constructor.prototype.constructor.prototype.constructor.prototype.constructor == Add)
    console.dir(Add.prototype)
    for(var key in Add.prototype) {
        console.log(key);
    }
    var add = new Add();
    const obj = {
        name: 'zhangli'
    }
    console.dir(obj)
    console.log(Function.prototype.constructor === Function)
    console.dir(Object.__proto__ === Function.prototype);
    console.log(Function.prototype.__proto__ === Object.prototype)

    var obj2 = {
        name: 'zhangli',
        list: {
            age: 21,
            sex: 'nan'
        }
    }
    function objClone(obj, nObj) {
        var nObj = nObj || {};
        for(var key in obj) {
            if (typeof obj[key] === 'object') {
                nObj[key] = (obj[key].constructor === Array) ? [] : {};
                objClone(obj[key], nObj[key]);
            } else {
                nObj[key] = obj[key]
            }
        }
        return nObj;
    }
    var obj3 = {
        height: 23
    }
    
    var obj3 = objClone(obj2, obj3);
    
    console.log(obj2)
    console.log(obj3)
    console.log(Object.constructor === Function)
    console.log(Function.__proto__ === Function.prototype);
    console.log(Function.prototype.__proto__ === Object.prototype)
</script>
</html>